package com.action.sanction;

import com.db.member.MemberManager;
import com.db.member.MemberVO;
import com.db.sancdoc.DocParamVO;
import com.db.sancdoc.VDocManager;
import com.db.sancdoc.VDocVO;
import com.opensymphony.xwork2.ActionContext;

import java.util.*;

import javax.print.Doc;

public class MyUndecidedAction {
	private int memno;

	ArrayList<VDocVO> list = new ArrayList<VDocVO>();

	MemberVO vo = new MemberVO();

	private int doccount;
	private int totalpage;
	private int curpage;
	private DocParamVO paramVo = new DocParamVO();

	public int getCurpage() {
		return curpage;
	}

	public void setCurpage(int curpage) {
		this.curpage = curpage;
	}

	public int getTotalpage() {
		return totalpage;
	}

	public int getDoccount() {
		return doccount;
	}

	public void setMemno(int memno) {
		this.memno = memno;
	}

	public ArrayList<VDocVO> getList() {
		return list;
	}

	public MemberVO getVo() {
		return vo;
	}

	public String execute() throws Exception {
memno = Integer.parseInt((String) ActionContext.getContext().getSession().get("memno"));//////////////////////////////////////////////////

		System.out.println(memno);

		System.out.println("MyUndecidedAction");

		vo = MemberManager.memberData(memno);

		paramVo = getDocParam(memno, curpage);
		list = VDocManager.undecidedDocList(paramVo);

		
		
		doccount = VDocManager.myUndecideCount(memno);
		totalpage = ((doccount-1) / 10) + 1;
		return "success";
	}

	public DocParamVO getDocParam(int memno, int curpage) {
		DocParamVO vo = new DocParamVO();
		vo.setMemno(memno);
		vo.setBegin((curpage * 10) - 9);
		vo.setEnd(curpage * 10);
		

		return vo;
	}
}
